package A2015;

public class _3_九数分三组 {
	static int[] a = new int[] {1,2,3,4,5,6,7,8,9};
	public static void main(String[] args) {
		f(0);

	}
	private static void f(int i) {
		if(i==9) {
			int A = 100*a[0]+10*a[1]+a[2];
			int B = 100*a[3]+10*a[4]+a[5];
			int C = 100*a[6]+10*a[7]+a[8];
			if(B==2*A && C==3*A)
				System.out.println(A+" "+B+" "+" "+C);
			return;
		}
		for(int j=i;j<9;j++) {
			swap(i,j);
			f(i+1);
			swap(i,j);
		}
	}

	private static void swap(int i, int j) {
		int t= a[i];
		a[i]=a[j];
		a[j]=t;		
	}
		

}
